large_numbersfandomcom-20200214-history
Factorial
The factorial is a function applied to whole numbers, defined asFactorial from Wolfram MathWorldFactorials from PurpleMath $$n! = \prod^n_{i = 1} i = n*(n-1)* ... *4*3*2*1.$$ For example, 6! = 6*5*4*3*2*1 = 720. It is equal to the number of ways n distinct objects can be arranged, because there are \(n\) ways to place the first object, n - 1 ways to place the second object, and so forth. The special case 0! = 1 has been set by definition; there is one way to arrange zero objects. Before the notation \(n!\) was invented, \(n\) was common. The function can be defined recursively as 0! = 1 and n! = n * (n - 1)!. The first few values of \(n!\) for \(n = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11\) are 1, 1 , 2, 6, 24, 120, 720, 5,040, 40,320, 362,880, 3,628,800, and 39,916,800. Properties The sum of the s of the factorials is = 0 + 1 + x + 1/(2!) + 1/(3!) ... = 2.71828182845904..., a mathematical constant better known as e. In fact, e^x = + ..., which illustrates the important property that \(\frac{d}{dx}e^x = e^x\). Because \(n! = \Gamma (n + 1)\) (where \(\Gamma (x)\) is the ), \(n! = \int^{\infty}_0 e^{-t} \cdot t^{n} dt\). This identity gives us factorials of positive real numbers (and negative non-integer real numbers), not limited to integers: *\(\left(\frac{1}{2}\right)! = \frac{\sqrt{\pi}}{2}\) *\(\left(-\frac{1}{2}\right)! = \sqrt{\pi}\) The most well-known approximation of n! is \(n!\approx \sqrt{2\pi n}(\frac{n}{e})^n\), and it's called . In base 10, only two non-trivial numbers are equal to the sum of the factorials of their digits: \(145 = 1! + 4! + 5! = 5 × 29\) and \(40,585 = 4! + 0! + 5! + 8! + 5! = 5 × 8,117\). The number of zeroes at the end of the decimal expansion of \(n!\) is \(\sum_{k = 1} \lfloor n / 5^k\rfloor\).Factorials and Trailing Zeroes from PurpleMath For example, 10,000! has 2,000 + 400 + 80 + 16 + 3 = 2,499 zeroes. Specific numbers * 479,001,600 is equal to \(12!\), and therefore the number of possible tone rows in the . * 1,124,000,727,777,607,680,000 is a positive integer equal to \(22!\). It is notable in computer science for being the largest factorial number which can be represented exactly in the double floating-point format (which has a 53-bit significand). **In the short scale, this number is written as 1 sextillion 124 quintillion 727 trillion 777 billion 607 million 680 thousand. **In the long scale, this number is written as 1 trilliard 124 trillion 727 billion 777 milliard 607 million 680 thousand. * 70! is the smallest factorial which is greater than googol, while 69! still has only 99 digits. * One hundred factorial's decimal expansion is shown below. *: **In scientific notation, this is approximately 9.3326215443 × . It seems to be approximately , although it is almost 100 million times larger. *Lawrence Hollom calls 200! faxul. *One thousand factorial is about 4.0238726007 × . *Aarex Tiaokhiao has proposed the name Myriadbang for 10,000!. *One million factorial is approximately 8.2639317 × 105,565,708. Variation Aalbert Torsius defines a variation on the factorial, where \(x!n = \prod^{x}_{i = 1} i!(n - 1) = 1!(n - 1) \cdot 2!(n - 1) \cdot \ldots \cdot x!(n - 1)\) and \(x!0 = x\).http://c2.com/cgi/wiki?ReallyBigNumbers \(x!n\) is pronounced "n''th level factorial of ''x." \(x!1\) is simply the ordinary factorial and \(x!2\) is Sloane and Plouffe's superfactorial \(x\$\). The special case \(x!x\) is a function known as the Torian. Pseudocode // Standard factorial function function factorial(z''): ''result := 1 for i'' '''from' 1 to z'': ''result := result * i'' '''return' result // Generalized factorial, using Lanczos approximation for gamma function g'' := 7 ''coeffs := 676.5203681218851, -1259.1392167224028, 771.32342877765313, -176.61502916214059, 12.507343278686905, -0.13857109526572012, 9.9843695780195716e-6, 1.5056327351493116e-7 function factorialReal(z''): ''ag := coeffs0 for i'' '''from' 1 to g'' + 1: ''ag := ag + coeffs[i''] / (''z + i'') ''zg := z'' + ''g + 0.5 return sqrt(2 * pi) * * * ag // Torsius' factorial extension function factorialTorsius(z'', ''x): if x'' = 0: '''return' z'' '''if' x'' = 1: '''return' factorial(z'') ''result := 1 for i'' '''from' 1 to z'': ''result := result * factorialTorsius(i'', ''x - 1) return result Sources See also de:Fakultät ja:階乗 nl:Faculteit